import Layout from '@/layout'

/** 曝光所有角色的权限路由列表 */
export const RouteRoleList = {
  superAdmin: [
    {
      path: '/setting',
      component: Layout,
      name: 'system_setting',
      meta: { title: '系统设置', icon: 'svginstall' },
      redirect: '/setting/homeDescription',
      children: [
        {
          path: 'homeDescription',
          name: 'home_description_setting',
          component: () => import('@/views/index/update'),
          meta: { title: '首页说明设置', icon: 'svghome' }
        },
        {
          path: 'reserveDescription',
          name: 'reserve_description_setting',
          component: () => import('@/views/setting/reserve'),
          meta: { title: '约车说明设置', icon: 'reserve' }
        },
        {
          path: 'rewardDescription',
          name: 'reward_description_setting',
          component: () => import('@/views/setting/reward'),
          meta: { title: '推广说明设置', icon: 'reward' }
        }
      ]
    },
    {
      path: '/package',
      component: Layout,
      name: 'package',
      meta: { title: '报考及套餐', icon: 'package' },
      children: [
        {
          path: 'add',
          name: 'add',
          component: () => import('@/views/package/add'),
          meta: { title: '添加套餐', icon: 'add' }
        },
        {
          path: 'list',
          name: 'list',
          component: () => import('@/views/package/list'),
          meta: { title: '套餐列表', icon: 'list' }
        },
        {
          path: 'edit',
          name: 'edit',
          component: () => import('@/views/package/edit'),
          meta: { title: '编辑套餐', icon: 'edit' },
          hidden: true
        }
      ]
    },
    {
      path: '/school',
      component: Layout,
      name: 'school',
      meta: { title: '分校设置', icon: 'school' },
      children: [
        {
          path: 'add',
          name: 'addSchool',
          component: () => import('@/views/school/add'),
          meta: { title: '添加分校', icon: 'add' }
        },
        {
          path: 'list',
          name: 'schoolList',
          component: () => import('@/views/school/list'),
          meta: { title: '分校列表', icon: 'list' }
        },
        {
          path: 'edit',
          name: 'schoolEdit',
          component: () => import('@/views/school/edit'),
          meta: { title: '分校编辑', icon: 'edit' },
          hidden: true
        },
        {
          path: 'place',
          name: 'placeManage',
          component: () => import('@/views/school/placeManage'),
          meta: { title: '场所管理', icon: 'place' },
          hidden: true
        },
        {
          path: 'allStudentList',
          name: 'allStudentList',
          component: () => import('@/views/school/studentList'),
          meta: { title: '学员列表', icon: 'studentList' }
        },
        {
          path: 'allCoachList',
          name: 'allCoachList',
          component: () => import('@/views/school/coachList'),
          meta: { title: '教练列表', icon: 'coachList' }
        }
      ]
    },
    {
      path: '/manager',
      name: 'manager',
      component: Layout,
      meta: { title: '管理员模块', icon: 'manager' },
      children: [
        {
          path: 'list',
          name: 'managerList',
          component: () => import('@/views/manager/list'),
          meta: { title: '管理员列表', icon: 'list' }
        },
        {
          path: 'add',
          name: 'addManager',
          component: () => import('@/views/manager/add'),
          meta: { title: '添加管理员', icon: 'add' }
        },
        {
          path: 'info',
          name: 'managerInfo',
          component: () => import('@/views/manager/info'),
          meta: { title: '管理员详情', icon: 'info' },
          hidden: true
        }
      ]
    },
    {
      path: '/coach',
      name: 'coach',
      component: Layout,
      meta: { title: '教练管理', icon: 'coach' },
      hidden: true,
      children: [
        {
          path: 'info',
          name: 'coachInfo',
          component: () => import('@/views/coach/info'),
          meta: { title: '教练信息', icon: 'info' },
          hidden: true
        },
        {
          path: 'studentList',
          name: 'coachStudentList',
          component: () => import('@/views/coach/studentList'),
          meta: { title: '属下学员', icon: 'list' },
          hidden: true
        },
        {
          path: 'enrollmentList',
          name: 'coachEnrollmentList',
          component: () => import('@/views/coach/enrollmentList'),
          meta: { title: '招生学员信息', icon: 'list' },
          hidden: true
        },
        {
          path: 'evaluateList',
          name: 'coachEvaluateList',
          component: () => import('@/views/coach/evaluate'),
          meta: { title: '评价详情', icon: 'list' },
          hidden: true
        },
        {
          path: 'teach',
          name: 'coachTeach',
          component: () => import('@/views/coach/teach'),
          meta: { title: '教学记录', icon: 'record' },
          hidden: true
        }
      ]
    },
    {
      path: '/student',
      name: 'student',
      component: Layout,
      meta: { title: '学员管理', icon: 'student' },
      hidden: true,
      children: [
        {
          path: 'record',
          name: 'studentRecord',
          component: () => import('@/views/student/record'),
          meta: { title: '练车记录', icon: 'record' },
          hidden: true
        },
        {
          path: 'recommend',
          name: 'studentRecommend',
          component: () => import('@/views/student/recommend'),
          meta: { title: '推荐学员', icon: 'recommend' },
          hidden: true
        },
        {
          path: 'info',
          name: 'studentInfo',
          component: () => import('@/views/student/info'),
          meta: { title: '学员信息', icon: 'info' },
          hidden: true
        }
      ]
    },
    {
      path: '/studentEvaluate',
      component: Layout,
      redirect: '/studentEvaluate/studentEvaluateList',
      children: [
        {
          path: 'studentEvaluateList',
          name: 'studentEvaluateList',
          component: () => import('@/views/school/evaluateList'),
          meta: { title: '学员评价箱', icon: 'evaluate' }
        }
      ]
    },
    {
      path: '/feedBack',
      component: Layout,
      redirect: '/feed/list',
      children: [
        {
          path: 'list',
          name: 'feedBackList',
          component: () => import('@/views/school/feedBack'),
          meta: { title: '意见反馈箱', icon: 'feedBack' }
        }
      ]
    },
    {
      path: '*',
      redirect: '/404'
    }
  ],
  schoolAdmin: [
    {
      path: '/student',
      name: 'student',
      component: Layout,
      meta: { title: '学员管理', icon: 'student' },
      children: [
        {
          path: 'list',
          name: 'studentList',
          component: () => import('@/views/student/list'),
          meta: { title: '学员列表', icon: 'list' }
        },
        {
          path: 'add',
          name: 'studentAdd',
          component: () => import('@/views/student/add'),
          meta: { title: '添加学员', icon: 'add' }
        },

        {
          path: 'record',
          name: 'studentRecord',
          component: () => import('@/views/student/record'),
          meta: { title: '练车记录', icon: 'record' },
          hidden: true
        },
        {
          path: 'recommend',
          name: 'studentRecommend',
          component: () => import('@/views/student/recommend'),
          meta: { title: '推荐学员', icon: 'recommend' },
          hidden: true
        },
        {
          path: 'info',
          name: 'studentInfo',
          component: () => import('@/views/student/info'),
          meta: { title: '学员信息', icon: 'info' },
          hidden: true
        }
      ]
    },
    {
      path: '/coach',
      name: 'coach',
      component: Layout,
      meta: { title: '教练管理', icon: 'coach' },
      children: [
        {
          path: 'add',
          name: 'coachAdd',
          component: () => import('@/views/coach/add'),
          meta: { title: '添加教练', icon: 'add' }
        },
        {
          path: 'list',
          name: 'coachList',
          component: () => import('@/views/coach/list'),
          meta: { title: '教练列表', icon: 'list' }
        },
        {
          path: 'info',
          name: 'coachInfo',
          component: () => import('@/views/coach/info'),
          meta: { title: '教练信息', icon: 'info' },
          hidden: true
        },
        {
          path: 'studentList',
          name: 'coachStudentList',
          component: () => import('@/views/coach/studentList'),
          meta: { title: '属下学员', icon: 'list' },
          hidden: true
        },
        {
          path: 'enrollmentList',
          name: 'coachEnrollmentList',
          component: () => import('@/views/coach/enrollmentList'),
          meta: { title: '招生学员信息', icon: 'list' },
          hidden: true
        },
        {
          path: 'evaluateList',
          name: 'coachEvaluateList',
          component: () => import('@/views/coach/evaluate'),
          meta: { title: '评价详情', icon: 'list' },
          hidden: true
        },
        {
          path: 'teach',
          name: 'coachTeach',
          component: () => import('@/views/coach/teach'),
          meta: { title: '教学记录', icon: 'record' },
          hidden: true
        }
      ]
    },
    {
      path: '/studentEvaluate',
      component: Layout,
      redirect: '/studentEvaluate/studentEvaluateList',
      children: [
        {
          path: 'studentEvaluateList',
          name: 'studentEvaluateList',
          component: () => import('@/views/school/evaluateList'),
          meta: { title: '学员评价箱', icon: 'evaluate' }
        }
      ]
    },
    {
      path: '/feedBack',
      component: Layout,
      redirect: '/feed/list',
      children: [
        {
          path: 'list',
          name: 'feedBackList',
          component: () => import('@/views/school/feedBack'),
          meta: { title: '意见反馈箱', icon: 'feedBack' }
        }
      ]
    },
    {
      path: '*',
      redirect: '/404'
    }
  ]
}

export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/index',
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/index/index'),
        meta: { title: '首页', icon: 'svghome' }
      }
    ]
  },
  // 404 page must be placed at the end !!!
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  }
]
